from flask import Flask
from flask import render_template
from handle import handler
from flask import json,request

app = Flask(__name__)


@app.route('/')
def index():
    return render_template("index.html")

@app.route('/get_left1_data')
def get_left1_data():
    return handler.l1_data()

@app.route('/get_left2_data')
def get_left2_data():
    return handler.l2_data()

@app.route('/get_left2_data_2',methods=['POST'])
def get_left2_data_2():
    type = json.loads(list(request.form)[0])["type"]
    return handler.l2_data_2(type)

@app.route('/get_center_data',methods=['POST'])
def get_center_data():
    count = json.loads(list(request.form)[0])["count"]
    center_data = handler.center_data(count)
    return center_data
@app.route('/get_right2_data')
def get_right2_data():
    return handler.r2_data()

if __name__ == '__main__':
    app.run()
